package com.bonuo.crm.service.impl;

import com.bonuo.crm.domain.Agent;
import com.bonuo.crm.mapper.ActivityMapper;
import com.bonuo.crm.mapper.AgentMapper;
import com.bonuo.crm.service.AgentService;
import com.ruoyi.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AgentServiceImpl implements AgentService {
    @Autowired
    private AgentMapper agentMapper;
    @Override
    @DataScope(provinceAlias = {"agent_info"})
    public List<Agent> selectAgentList(Agent agent) {
        return agentMapper.selectAgentList(agent);
    }

    @Override
    public Integer insertAgent(Agent agent) {
        int add = agentMapper.insertAgent(agent);
        return add;
    }

    @Override
    public Integer deleteAgentById(Integer id) {
        int delete = agentMapper.deleteAgentById(id);
        return delete;
    }

    @Override
    public Integer updateAgent(Agent agent) {
        int update = agentMapper.updateAgent(agent);
        return update;
    }

    @Override
    public String selectClientByTaxNumber(Agent agent) {
        return agentMapper.selectClientByTaxNumber(agent);
    }
}
